package com.oo.packaging_2.dog;

/**
 * Dog--${description}
 *
 * @author: Jovi
 * @createTime: 2017-04-19 14:03
 **/
public class Dog {

    private String type;

    private int age;

    private String name;

    private String mood;

    public Dog(String type, int age, String name, String mood) {
        this.type = type;
        this.age = age;
        this.name = name;
        this.mood = mood;
    }

    public void shout() {
        String msg = "名字叫" + this.name + "的" + this.type;
        if (this.mood.equals("心情好")) {
            msg += "心情很好，开心的汪汪叫";
        } else {
            msg += "心情不好，呜呜的叫";
        }
        System.out.println(msg);
    }

    public void run() {
        String msg = "名字叫" + this.name + "的" + this.type;
        if (this.mood.equals("心情好")) {
            msg += "心情很好，开心的围着主人身边转";
        } else {
            msg += "心情不好，伤心的一动不动";
        }
        System.out.println(msg);

    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMood() {
        return mood;
    }

    public void setMood(String mood) {
        if (!(mood.equals("心情好")) && !(mood.equals("心情不好"))) {
            System.out.println("输入信息错误，这只狗狗心情很好！");
            this.mood = "心情好";
        } else
        this.mood = mood;
    }
}
